/*
* cblas.cpp
* 
* Copyright (c) 2003-2004, .NET Analytics Project. All rights reserved.
*/

#ifdef _WINDOWS
	#ifndef VC_EXTRALEAN
		#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
	#endif
	#include "windows.h"
	
	BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ){
		return TRUE;
	}
	#define DLLEXPORT __declspec( dllexport )
#else
	#define DLLEXPORT
#endif

extern "C" {
    #ifdef WRAP_VECLIB
    	#include <vecLib/vecLib.h>
	#define rint int
    #else
        #ifdef WRAP_MKL
        	#include "mkl_cblas.h"
		#define rint size_t
        #else
 		#include "cblas.h"
		#define rint int
        #endif
    #endif
}

#ifdef WRAP_MKL
    #define ORDER CBLAS_ORDER
    #define TRANSPOSE CBLAS_TRANSPOSE
    #define UPLO CBLAS_UPLO
    #define DIAG CBLAS_DIAG
    #define SIDE CBLAS_SIDE
#else
    #define ORDER enum CBLAS_ORDER
    #define TRANSPOSE enum CBLAS_TRANSPOSE
    #define UPLO enum CBLAS_UPLO
    #define DIAG enum CBLAS_DIAG
    #define SIDE enum CBLAS_SIDE
#endif


extern "C" {

    void DLLEXPORT dna_blas_dcopy(const int N, double* X, const int incX, double* Y, const int incY){
        cblas_dcopy(N, X, incX, Y, incY);
    }

    void DLLEXPORT dna_blas_zcopy(const int N, void* X, const int incX, void* Y, const int incY){
        cblas_zcopy(N, X, incX, Y, incY);
    }

    double DLLEXPORT dna_blas_ddot(const int N, double* X, const int incX, double* Y, const int incY){
        return cblas_ddot(N, X, incX, Y, incY);
    }

    void DLLEXPORT dna_blas_zdotc(const int N, const void* X, const int incX, const void* Y, const int incY, void* dotc){
        cblas_zdotc_sub(N, X, incX, Y, incY, dotc);
    }

    void DLLEXPORT dna_blas_zdotu(const int N, const void* X, const int incX, const void* Y, const int incY, void* dotu){
        cblas_zdotu_sub(N, X, incX, Y, incY, dotu);
    }

    double DLLEXPORT dna_blas_dnrm2(const int N, const double* X, const int incX){
        return cblas_dnrm2(N, X, incX);
    }

    double DLLEXPORT dna_blas_dznrm2(const int N, const void* X, const int incX){
        return cblas_dznrm2(N, X, incX);
    }

    double DLLEXPORT dna_blas_dasum(const int N, const double* X, const int incX){
        return cblas_dasum(N, X, incX);
    }

    double DLLEXPORT dna_blas_dzasum(const int N, const void* X, const int incX){
        return cblas_dzasum(N, X, incX);
    }

	float DLLEXPORT dna_blas_sdsdot(const int N, const float alpha, const float *X, const int incX, const float *Y, const int incY){
		return cblas_sdsdot(N, alpha, X, incX, Y, incY);
	}

	double DLLEXPORT dna_blas_dsdot(const int N, const float *X, const int incX, const float *Y, const int incY){
		return cblas_dsdot(N, X, incX, Y, incY);
	}

	float DLLEXPORT dna_blas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY){
		return cblas_sdot(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_cdotu(const int N, const void* X, const int incX, const void* Y, const int incY, void* dotu){
		cblas_cdotu_sub(N, X, incX, Y, incY, dotu);
	}

	void DLLEXPORT dna_blas_cdotc(const int N, const void* X, const int incX, const void* Y, const int incY, void* dotc){
		return cblas_cdotc_sub(N, X, incX, Y, incY, dotc);
	}

	float DLLEXPORT dna_blas_snrm2(const int N, const float* X, const int incX){
		return cblas_snrm2(N, X, incX);
	}

	float DLLEXPORT dna_blas_sasum(const int N, const float* X, const int incX){
		return cblas_sasum(N, X, incX);
	}

	float DLLEXPORT dna_blas_scnrm2(const int N, const void* X, const int incX){
		return cblas_scnrm2(N, X, incX);
	}

	float DLLEXPORT dna_blas_scasum(const int N, const void* X, const int incX){
		return cblas_scasum(N, X, incX);
	}

   void DLLEXPORT dna_blas_sswap(const int N, float *X, const int incX, float *Y, const int incY){
		cblas_sswap(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_scopy(const int N, const float *X, const int incX, float *Y, const int incY){
		cblas_scopy(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_saxpy(const int N, const float alpha, const float *X, const int incX, float *Y, const int incY){
		cblas_saxpy(N, alpha, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_dswap(const int N, double *X, const int incX, double *Y, const int incY){
		cblas_dswap(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_daxpy(const int N, const double alpha, const double *X, const int incX, double *Y, const int incY){
		cblas_daxpy(N, alpha, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_cswap(const int N, void *X, const int incX, void *Y, const int incY){
		cblas_cswap(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_ccopy(const int N, const void *X, const int incX, void *Y, const int incY){
		cblas_ccopy(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_caxpy(const int N, const void *alpha, const void *X, const int incX, void *Y, const int incY){
		cblas_caxpy(N, alpha, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_zswap(const int N, void *X, const int incX, void *Y, const int incY){
		cblas_zswap(N, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_zaxpy(const int N, const void *alpha, const void *X, const int incX, void *Y, const int incY){
		cblas_zaxpy(N, alpha, X, incX, Y, incY);
	}

	void DLLEXPORT dna_blas_srotg(float *a, float *b, float *c, float *s){
		cblas_srotg(a, b, c, s);
	}

    void DLLEXPORT dna_blas_srotmg(float *d1, float *d2, float *b1, const float* b2, float *P){
        #ifdef WRAP_MKL
            cblas_srotmg(d1, d2, b1, b2, P);
        #else
            cblas_srotmg(d1, d2, b1, *b2, P);
        #endif
    }

	void DLLEXPORT dna_blas_srot(const int N, float *X, const int incX, float *Y, const int incY, const float c, const float s){
		cblas_srot(N, X, incX, Y, incY, c, s);
	}

	void DLLEXPORT dna_blas_srotm(const int N, float *X, const int incX, float *Y, const int incY, const float *P){
		cblas_srotm(N, X, incX, Y, incY, P);
	}

	void DLLEXPORT dna_blas_drotg(double *a, double *b, double *c, double *s){
		cblas_drotg(a, b, c, s);
	}

    void DLLEXPORT dna_blas_drotmg(double *d1, double *d2, double *b1, const double* b2, double *P){
        #ifdef WRAP_MKL
            cblas_drotmg(d1, d2, b1, b2, P);
        #else
            cblas_drotmg(d1, d2, b1, *b2, P);
        #endif
    }

    void DLLEXPORT dna_blas_drot(const int N, double *X, const int incX, double *Y, const int incY, const double c, const double s){
		cblas_drot(N, X, incX, Y, incY, c, s);
	}

	void DLLEXPORT dna_blas_drotm(const int N, double *X, const int incX, double *Y, const int incY, const double *P){
		cblas_drotm(N, X, incX, Y, incY, P);
	}

	void DLLEXPORT dna_blas_sscal(const int N, const float alpha, float *X, const int incX){
		cblas_sscal(N, alpha, X, incX);
	}

	void DLLEXPORT dna_blas_dscal(const int N, const double alpha, double *X, const int incX){
		cblas_dscal(N, alpha, X, incX);
	}

	void DLLEXPORT dna_blas_cscal(const int N, const void *alpha, void *X, const int incX){
		cblas_cscal(N, alpha, X, incX);
	}

	void DLLEXPORT dna_blas_zscal(const int N, const void *alpha, void *X, const int incX){
		cblas_zscal(N, alpha, X, incX);
	}

	void DLLEXPORT dna_blas_csscal(const int N, const float alpha, void *X, const int incX){
		cblas_csscal(N, alpha, X, incX);
	}

	void DLLEXPORT dna_blas_zdscal(const int N, const double alpha, void *X, const int incX){
		cblas_zdscal(N, alpha, X, incX);
	}
	
	void DLLEXPORT dna_blas_dsymv(const ORDER Order, const UPLO Uplo, const int N, const double alpha, const double *A,
		const int lda, const double *X, const int incX, const double beta, double *Y, const int incY){
		cblas_dsymv(Order, Uplo, N, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_dsbmv(const ORDER Order, const UPLO Uplo, const int N, const int K, const double alpha, const double *A,
		const int lda, const double *X, const int incX, const double beta, double *Y, const int incY){
		cblas_dsbmv(Order, Uplo, N, K, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_dspmv(const ORDER Order, const UPLO Uplo, const int N, const double alpha, const double *Ap,
		const double *X, const int incX, const double beta, double *Y, const int incY){
		cblas_dspmv(Order, Uplo, N, alpha, Ap, X, incX, beta, Y, incY);
	}
	
	void DLLEXPORT dna_blas_dger(const ORDER Order, const int M, const int N, const double alpha, const double *X, const int incX,
		const double *Y, const int incY, double *A, const int lda){
		cblas_dger(Order, M, N, alpha, X, incX, Y, incY, A, lda);
	}

	void DLLEXPORT dna_blas_dsyr(const ORDER Order, const UPLO Uplo,
		const int N, const double alpha, const double *X,const int incX, double *A, const int lda){
		cblas_dsyr( Order, Uplo, N, alpha, X, incX, A, lda);
	}
	
	void DLLEXPORT dna_blas_dspr(const ORDER Order, const UPLO Uplo,
		const int N, const double alpha, const double *X, const int incX, double *Ap){
		cblas_dspr( Order, Uplo, N, alpha, X,incX, Ap);
	}
	
	void DLLEXPORT dna_blas_dsyr2(const ORDER Order, const UPLO Uplo, const int N, const double alpha, const double *X,
		const int incX, const double *Y, const int incY, double *A, const int lda){
		cblas_dsyr2(Order, Uplo, N, alpha, X, incX, Y, incY, A, lda);
	}
	
	void DLLEXPORT dna_blas_dspr2(const ORDER Order, const UPLO Uplo, const int N, const double alpha, const double *X,
		const int incX, const double *Y, const int incY, double *A){
		cblas_dspr2( Order, Uplo, N, alpha, X, incX, Y, incY, A);
	}

    void DLLEXPORT dna_blas_crotg(void *a, void *b, void *c, void *s){
        #ifdef WRAP_MKL
            cblas_crotg( a, b, reinterpret_cast<float*>(c), s);
        #else
            cblas_crotg( a, b, c, s);
        #endif
    }

    void DLLEXPORT dna_blas_zrotg(void *a, void *b, void *c, void *s){
        #ifdef WRAP_MKL
            cblas_zrotg( a, b, reinterpret_cast<double*>(c), s);
        #else
            cblas_zrotg( a, b, c, s);
        #endif
    }

	void DLLEXPORT dna_blas_csrot(const int N, void *X, const int incX, void *Y, const int incY, const float c, const float s){
		cblas_csrot(N, X, incX, Y, incY, c, s);
	}
	void DLLEXPORT dna_blas_zdrot(const int N, void *X, const int incX, void *Y, const int incY, const double c, const double s){
		cblas_zdrot(N, X, incX, Y, incY, c, s);
	}

	rint DLLEXPORT dna_blas_isamax(const int N, const float *X, const int incX){
		return cblas_isamax(N, X, incX);
	}

    rint DLLEXPORT dna_blas_idamax(const int N, const double  *X, const int incX){
		return cblas_idamax(N, X, incX);
	}

    rint DLLEXPORT dna_blas_icamax(const int N, const void *X, const int incX){
		return cblas_icamax(N, X, incX);
	}

	rint DLLEXPORT dna_blas_izamax(const int N, const void  *X, const int incX){
		return cblas_izamax(N, X, incX);
	}
	
	void DLLEXPORT dna_blas_sgemv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const float alpha, const float *A, const int lda, const float *X, const int incX, const float beta,
		float *Y, const int incY){
			cblas_sgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
	void DLLEXPORT dna_blas_sgbmv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const int KL, const int KU, const float alpha, const float *A, const int lda, const float *X,
		const int incX, const float beta, float *Y, const int incY){
		cblas_sgbmv(Order, TransA, M, N, KL, KU, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_strmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const float *A, const int lda, float *X, const int incX){
		cblas_strmv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_stbmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const int K, const float *A, const int lda, float *X, const int incX){
		cblas_stbmv(Order, Uplo, TransA, Diag, N, K, A, lda, X, incX);
	}
	
	void DLLEXPORT dna_blas_strsv(const ORDER Order, const UPLO Uplo,const TRANSPOSE TransA, const DIAG Diag,
		const int N, const float *A, const int lda, float *X, const int incX){
		cblas_strsv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_stpsv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const float *Ap, float *X, const int incX){
		cblas_stpsv(Order, Uplo, TransA, Diag, N, Ap, X, incX);
	}
   
   void DLLEXPORT dna_blas_dgemv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const double alpha, const double *A, const int lda, const double *X, const int incX, const double beta,
		double *Y, const int incY){
			cblas_dgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
	void DLLEXPORT dna_blas_dgbmv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const int KL, const int KU, const double alpha, const double *A, const int lda, const double *X,
		const int incX, const double beta, double *Y, const int incY){
		cblas_dgbmv(Order, TransA, M, N, KL, KU, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_dtrmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const double *A, const int lda, double *X, const int incX){
		cblas_dtrmv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_dtbmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const int K, const double *A, const int lda, double *X, const int incX){
		cblas_dtbmv(Order, Uplo, TransA, Diag, N, K, A, lda, X, incX);
	}
	
	void DLLEXPORT dna_blas_dtrsv(const ORDER Order, const UPLO Uplo,const TRANSPOSE TransA, const DIAG Diag,
		const int N, const double *A, const int lda, double *X, const int incX){
		cblas_dtrsv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_dtpsv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const double *Ap, double *X, const int incX){
		cblas_dtpsv(Order, Uplo, TransA, Diag, N, Ap, X, incX);
	}


   void DLLEXPORT dna_blas_cgemv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const void* alpha, const void *A, const int lda, const void *X, const int incX, const void* beta,
		void *Y, const int incY){
			cblas_cgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
	void DLLEXPORT dna_blas_cgbmv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const int KL, const int KU, const void* alpha, const void *A, const int lda, const void *X,
		const int incX, const void* beta, void *Y, const int incY){
		cblas_cgbmv(Order, TransA, M, N, KL, KU, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_ctrmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *A, const int lda, void *X, const int incX){
		cblas_ctrmv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_ctbmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const int K, const void *A, const int lda, void *X, const int incX){
		cblas_ctbmv(Order, Uplo, TransA, Diag, N, K, A, lda, X, incX);
	}
	
	void DLLEXPORT dna_blas_ctrsv(const ORDER Order, const UPLO Uplo,const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *A, const int lda, void *X, const int incX){
		cblas_ctrsv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_ctpsv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *Ap, void *X, const int incX){
		cblas_ctpsv(Order, Uplo, TransA, Diag, N, Ap, X, incX);
	}
   

   void DLLEXPORT dna_blas_zgemv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const void* alpha, const void *A, const int lda, const void *X, const int incX, const void* beta,
		void *Y, const int incY){
			cblas_zgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
	void DLLEXPORT dna_blas_zgbmv(const ORDER Order, const TRANSPOSE TransA, const int M, const int N,
		const int KL, const int KU, const void* alpha, const void *A, const int lda, const void *X,
		const int incX, const void* beta, void *Y, const int incY){
		cblas_zgbmv(Order, TransA, M, N, KL, KU, alpha, A, lda, X, incX, beta, Y, incY);
	}

	void DLLEXPORT dna_blas_ztrmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *A, const int lda, void *X, const int incX){
		cblas_ztrmv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_ztbmv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const int K, const void *A, const int lda, void *X, const int incX){
		cblas_ztbmv(Order, Uplo, TransA, Diag, N, K, A, lda, X, incX);
	}
	
	void DLLEXPORT dna_blas_ztrsv(const ORDER Order, const UPLO Uplo,const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *A, const int lda, void *X, const int incX){
		cblas_ztrsv(Order, Uplo, TransA, Diag, N, A, lda, X, incX);
	}

	void DLLEXPORT dna_blas_ztpsv(const ORDER Order, const UPLO Uplo, const TRANSPOSE TransA, const DIAG Diag,
		const int N, const void *Ap, void *X, const int incX){
		cblas_ztpsv(Order, Uplo, TransA, Diag, N, Ap, X, incX);
	}

	
  	void DLLEXPORT dna_blas_ssymv(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *A,
		const int lda, const float *X, const int incX, const float beta, float *Y, const int incY){
		cblas_ssymv(Order, Uplo, N, alpha, A, lda, X, incX, beta, Y, incY);
	}

  	void DLLEXPORT dna_blas_ssbmv(const ORDER Order, const UPLO Uplo, const int N, const int K, const float alpha, const float *A,
		const int lda, const float *X, const int incX, const float beta, float *Y, const int incY){
		cblas_ssbmv(Order, Uplo, N, K, alpha, A, lda, X, incX, beta, Y, incY);
	}
  	
   void DLLEXPORT dna_blas_sspmv(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *Ap,
		const float *X, const int incX, const float beta, float *Y, const int incY){
		cblas_sspmv(Order, Uplo, N, alpha, Ap, X, incX, beta, Y, incY);
	}
	
   void DLLEXPORT dna_blas_sger(const ORDER Order, const int M, const int N, const float alpha, const float *X, const int incX,
		const float *Y, const int incY, float *A, const int lda){
		cblas_sger(Order, M, N, alpha, X, incX, Y, incY, A, lda);
	}

   void DLLEXPORT dna_blas_ssyr(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *X,
		const int incX, float *A, const int lda){
		cblas_ssyr(Order, Uplo, N, alpha, X, incX, A, lda);
	}

   void DLLEXPORT dna_blas_sspr(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *X,
		const int incX, float *Ap){
		cblas_sspr(Order, Uplo, N, alpha, X, incX, Ap);
	}

   void DLLEXPORT dna_blas_ssyr2(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *X,
		const int incX, const float *Y, const int incY, float *A, const int lda){
		cblas_ssyr2(Order, Uplo, N, alpha, X, incX, Y, incY, A, lda);
	}
	
   void DLLEXPORT dna_blas_sspr2(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const float *X,
		const int incX, const float *Y, const int incY, float *A, const int lda){
		cblas_sspr2(Order, Uplo, N, alpha, X, incX, Y, incY, A);
	}
	
   
   void DLLEXPORT dna_blas_chemv(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *A,
		const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_chemv(Order, Uplo, N, alpha, A, lda, X, incX, beta, Y, incY);
	}

   void DLLEXPORT dna_blas_chbmv(const ORDER Order, const UPLO Uplo, const int N, const int K, const void *alpha, const void *A,
		const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_chbmv(Order, Uplo, N, K, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
   void DLLEXPORT dna_blas_chpmv(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *Ap,
		const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_chpmv(Order, Uplo, N, alpha, Ap, X, incX, beta, Y, incY);
	}
	
   void DLLEXPORT dna_blas_cgeru(const ORDER Order, const int M, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_cgeru(Order, M, N, alpha, X, incX, Y, incY, A, lda);
	}
   
   void DLLEXPORT dna_blas_cgerc(const ORDER Order, const int M, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_cgerc(Order, M,N, alpha, X, incX, Y, incY, A, lda);
	}
	
   void DLLEXPORT dna_blas_cher(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const void *X, const int incX,
		void *A, const int lda){
		cblas_cher(Order, Uplo, N, alpha, X, incX, A, lda);
	}
	
   void DLLEXPORT dna_blas_chpr(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const void *X,
		const int incX, void *A){
		cblas_chpr(Order, Uplo, N, alpha, X, incX, A);
	}
	
   void DLLEXPORT dna_blas_cher2(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_cher2(Order, Uplo, N, alpha, X, incX, Y, incY, A, lda);
	}
	
   void DLLEXPORT dna_blas_chpr2(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *Ap){
		cblas_chpr2(Order, Uplo, N, alpha, X, incX, Y, incY, Ap);
	}
	
	
   void DLLEXPORT dna_blas_zhemv(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *A,
		const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_zhemv(Order, Uplo, N, alpha, A, lda, X, incX, beta, Y, incY);
	}

   void DLLEXPORT dna_blas_zhbmv(const ORDER Order, const UPLO Uplo, const int N, const int K, const void *alpha, const void *A,
		const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_zhbmv(Order, Uplo, N, K, alpha, A, lda, X, incX, beta, Y, incY);
	}
	
   void DLLEXPORT dna_blas_zhpmv(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *Ap,
		const void *X, const int incX, const void *beta, void *Y, const int incY){
		cblas_zhpmv(Order, Uplo, N, alpha, Ap, X, incX, beta, Y, incY);
	}
	
   void DLLEXPORT dna_blas_zgeru(const ORDER Order, const int M, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_zgeru(Order, M, N, alpha, X, incX, Y, incY, A, lda);
	}
   
   void DLLEXPORT dna_blas_zgerc(const ORDER Order, const int M, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_zgerc(Order, M,N, alpha, X, incX, Y, incY, A, lda);
	}
	
   void DLLEXPORT dna_blas_zher(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const void *X, const int incX,
		void *A, const int lda){
		cblas_zher(Order, Uplo, N, alpha, X, incX, A, lda);
	}
	
   void DLLEXPORT dna_blas_zhpr(const ORDER Order, const UPLO Uplo, const int N, const float alpha, const void *X,
		const int incX, void *A){
		cblas_zhpr(Order, Uplo, N, alpha, X, incX, A);
	}
	
   void DLLEXPORT dna_blas_zher2(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *A, const int lda){
		cblas_zher2(Order, Uplo, N, alpha, X, incX, Y, incY, A, lda);
	}
	
   void DLLEXPORT dna_blas_zhpr2(const ORDER Order, const UPLO Uplo, const int N, const void *alpha, const void *X, const int incX,
		const void *Y, const int incY, void *Ap){
		cblas_zhpr2(Order, Uplo, N, alpha, X, incX, Y, incY, Ap);
	}


   void DLLEXPORT dna_blas_sgemm(const ORDER Order, const TRANSPOSE TransA, const TRANSPOSE TransB, const int M, const int N,
		const int K, const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc){
		cblas_sgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
   
   void DLLEXPORT dna_blas_ssymm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
		const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc){
		cblas_ssymm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_ssyrk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const float alpha, const float *A, const int lda, const float beta, float *C, const int ldc){
		cblas_ssyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
	}

   void DLLEXPORT dna_blas_ssyr2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc){
		cblas_ssyr2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_strmm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const float alpha, const float *A, const int lda, float *B, const int ldb){
		cblas_strmm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}
	
   void DLLEXPORT dna_blas_strsm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const float alpha, const float *A, const int lda, float *B, const int ldb){
		cblas_strsm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}
	

   void DLLEXPORT dna_blas_dgemm(const ORDER Order, const TRANSPOSE TransA, const TRANSPOSE TransB, const int M, const int N,
		const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc){
		cblas_dgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
   
   void DLLEXPORT dna_blas_dsymm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
		const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc){
		cblas_dsymm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_dsyrk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc){
		cblas_dsyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
	}

   void DLLEXPORT dna_blas_dsyr2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc){
		cblas_dsyr2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_dtrmm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const double alpha, const double *A, const int lda, double *B, const int ldb){
		cblas_dtrmm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}
	
   void DLLEXPORT dna_blas_dtrsm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const double alpha, const double *A, const int lda, double *B, const int ldb){
		cblas_dtrsm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}


   void DLLEXPORT dna_blas_cgemm(const ORDER Order, const TRANSPOSE TransA, const TRANSPOSE TransB, const int M, const int N,
		const int K, const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_cgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
   
   void DLLEXPORT dna_blas_csymm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
		const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_csymm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_csyrk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const void* alpha, const void *A, const int lda, const void* beta, void *C, const int ldc){
		cblas_csyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
	}

   void DLLEXPORT dna_blas_csyr2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_csyr2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_ctrmm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const void* alpha, const void *A, const int lda, void *B, const int ldb){
		cblas_ctrmm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}
	
   void DLLEXPORT dna_blas_ctrsm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const void* alpha, const void *A, const int lda, void *B, const int ldb){
		cblas_ctrsm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}

   void DLLEXPORT dna_blas_zgemm(const ORDER Order, const TRANSPOSE TransA, const TRANSPOSE TransB, const int M, const int N,
		const int K, const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_zgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
   
   void DLLEXPORT dna_blas_zsymm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
		const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_zsymm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_zsyrk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const void* alpha, const void *A, const int lda, const void* beta, void *C, const int ldc){
		cblas_zsyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc);
	}

   void DLLEXPORT dna_blas_zsyr2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
		const void* alpha, const void *A, const int lda, const void *B, const int ldb, const void* beta, void *C, const int ldc){
		cblas_zsyr2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_ztrmm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const void* alpha, const void *A, const int lda, void *B, const int ldb){
		cblas_ztrmm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}
	
   void DLLEXPORT dna_blas_ztrsm(const ORDER Order, const SIDE Side, const UPLO Uplo, const TRANSPOSE TransA,
		const DIAG Diag, const int M, const int N, const void* alpha, const void *A, const int lda, void *B, const int ldb){
		cblas_ztrsm(Order, Side, Uplo, TransA, Diag, M, N, alpha, A, lda, B, ldb);
	}

   void DLLEXPORT dna_blas_chemm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
	const void *alpha, const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc){
		cblas_chemm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
 
   void DLLEXPORT dna_blas_cherk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
	const float alpha, const void *A, const int lda, const float beta, void *C, const int ldc){
		cblas_cherk(Order, Uplo, Trans, N, K, alpha, A, lda,beta, C, ldc);
	}

   void DLLEXPORT dna_blas_cher2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
	const void *alpha, const void *A, const int lda, const void *B, const int ldb, const float beta, void *C, const int ldc){
		cblas_cher2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
	
   void DLLEXPORT dna_blas_zhemm(const ORDER Order, const SIDE Side, const UPLO Uplo, const int M, const int N,
	const void *alpha, const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc){
		cblas_zhemm(Order, Side, Uplo, M, N, alpha, A, lda, B, ldb, beta, C, ldc);
	}
 
   void DLLEXPORT dna_blas_zherk(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
	const double alpha, const void *A, const int lda, const double beta, void *C, const int ldc){
		cblas_zherk(Order, Uplo, Trans, N, K, alpha, A, lda,beta, C, ldc);
	}

   void DLLEXPORT dna_blas_zher2k(const ORDER Order, const UPLO Uplo, const TRANSPOSE Trans, const int N, const int K,
	const void *alpha, const void *A, const int lda, const void *B, const int ldb, const double beta, void *C, const int ldc){
		cblas_zher2k(Order, Uplo, Trans, N, K, alpha, A, lda, B, ldb, beta, C, ldc);
	}
}

